import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

public class Demo6 {
    public static void main(String[] args) {
        LocalTime localTime = LocalTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("mm:ss");

        System.out.println(localTime.format(formatter));    //指定格式输出
        System.out.println(localTime);                      //默认格式输出
    }
}
